package com.pkx.cloud.fse7.dms.openrecord.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pkx.cloud.fse7.dms.openrecord.repo.OpenRecordYearMapper;
import com.pkx.cloud.fse7.dms.openrecord.service.OpenRecordYearService;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 *  服务实现类
 *
 * @author chenwg
 * @since 2020-10-14
 */
@Service
public class OpenRecordYearServiceImpl implements OpenRecordYearService {

    @Resource
    private OpenRecordYearMapper openRecordYearMapper;
    /**
     * 分页列表
     *
     * @param page
     * @return
     */
    @Override
    @Cacheable(cacheNames = "year",key = "#page.current+':'+#page.size+':'+#devName")
    public Page pageList(Page page, String devName) {
        return openRecordYearMapper.list(page,devName);
    }

    /**
     * 列表查询
     *
     * @return
     */
    @Override
    public List listByEntity() {
        return openRecordYearMapper.list();
    }


}
